#pragma once
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include "../dkgl/include/dkgl.h"

using namespace DKGL;

class CController : public DKGL::MouseVF
{
public:

	CController ();

	void Init (FeetOnTerrain *ft, Camera *cam, BaseObject*, BaseObject*, float sen, WORD width, WORD height);

	void LeftDrag(int x, int y);
	void RightDrag(int x, int y);

	void pressKey(char key);
	
	inline bool beWheel () { return m_bIsZooming; };
	void Wheel (short delta);
	void Zoom ();

	void Render ();

private:

	//BaseObject	*m_root;
	FeetOnTerrain *m_FT;
	Camera *m_camera;
	BaseObject *m_pHNode, *m_pVNode;

	WORD		m_width, m_height;

	WORD		m_wTimer;
	WORD		m_wZoomDir;
	float		m_sensitivity;
	bool		m_bIsZooming;

	void Begin2D ();
	void End2D ();

	void DrawLine2D (WORD x1, WORD y1, WORD x2, WORD y2);
	void DrawCircle2D (WORD x, WORD y, float radius);
};
